package com.test.timmy;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Immutable.
 *
 */
public class LifeEvent
{
	public static final String TAG_EVENT = "event";
	
	private static final String TAG_LABEL = "label";
	private static final String TAG_CHANGES = "changes";

	private JSONObject details;

	public LifeEvent(JSONObject details)
	{
		this.details = details;
	}
	
	public String getLabel()
			throws JSONException
	{
		return details.getString(TAG_LABEL);
	}
	
	public Changes getChanges()
			throws NumberFormatException, JSONException
	{
		return new Changes(details.getJSONObject(TAG_CHANGES));
	}
}
